/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package es.unavarra.mti.iws.model;

import es.unavarra.mti.iws.logic.editor.Selectable;
import es.unavarra.mti.iws.logic.properties.HasProperties;
import es.unavarra.mti.iws.logic.properties.KProperty;
import es.unavarra.mti.iws.utils.ReflectionUtils;
import java.util.List;

/**
 *
 * @author Marcelo
 */
public class Event extends Object2D implements Selectable{
    private float radious;

    public Event() {
        radious = 60.0f;
    }

    public float getRadious() {
        return radious;
    }

    public void setRadious(float radious) {
        this.radious = radious;
    }

    public void setPosition(float x, float y) {
        setX(x); setY(y);
    }

    public float getSizeX() {
        return radious*2;
    }

    public float getSizeY() {
        return radious*2;
    }

    @Override
    public List<KProperty> objectProperties() {
        List<KProperty> prop = super.objectProperties();
        insertMyProperties(prop);
        return prop;
    }


    @Override
    public List<KProperty> objectProperties(Class<? extends HasProperties> c) {
        if (Event.class.isAssignableFrom( c )){
            List<KProperty> prop = super.objectProperties();
            insertMyProperties(prop);
            return prop;
        }
        return super.objectProperties(c);
    }

    private void insertMyProperties(List<KProperty> prop) {
        prop.add(ReflectionUtils.createProperty(Event.class, "radious").setName("radio"));
    }
   
}
